#include <ApeTest/testFsObject.h>
#include <Ape/String.h>
#include <Ape/Collections/Array.h>
#include <Ape/IO/FS/RegularFile.h>
#include <Ape/IO/Console.h>

using namespace Ape;
using namespace Ape::Collections;
using namespace Ape::IO::FS;
using namespace Ape::IO;

void testFsObject (Array<String>& files) {
	Array<unsigned char> buff (256, NULL);
	foreach (it, Array<String>, files) {
		String fileName = it;
		StdOut << L"=== Openning file: '" << fileName << L"' ===" << NewLine;
		RegularFile f1 (fileName);
		f1.Open();
		size_t actuallyRead = 0;
		while ( (actuallyRead = f1.Read (buff) ) ) {
			for (size_t i = 0; i < actuallyRead; i++) {
				unsigned char ch = buff[i];
				printf ("%c", ch);
			}
		}
		printf ("\n");
	}
}
